package org.cy.spring.learning.proxy.jdk.statics;

import lombok.extern.slf4j.Slf4j;
import org.cy.spring.learning.proxy.SayHello;

/**
 * JDK 静态代理
 *
 * create date: 2019/10/18 13:46
 *
 * @author cao.yong
 */
@Slf4j
public class StaticProxy implements SayHello {

    private SayHello sayHello;

    public StaticProxy(SayHello sayHello) {
        this.sayHello = sayHello;
    }

    @Override
    public void to(String name) {
        log.info("JDK 静态代理执行");
        sayHello.to(name);
    }
}
